package pattern.strategy

import pattern.strategy.behavior.fly.FlyBehavior
import pattern.strategy.behavior.quack.QuackBehavior

/**
 * Created by root on 15-9-17.
 */
abstract class Duck {

  protected val quackBehavior:QuackBehavior
  protected val flyBehavior:FlyBehavior

  def performQuack(): Unit ={
    quackBehavior.quack()
  }

  def performFly(): Unit ={
    flyBehavior.fly()
  }

  def swim: Unit ={
    println("swimming!!!!")
  }

  def disply: Unit ={
    println("duck duck duck !!!")
  }
}
